<?php

/**
 * 调试工具
 * @author iorichina
 *
 */
class DebugTool
{

    /**
     * @var string 显示代码的前缀
     */
    public static $_pre = '<pre>';

    /**
     * @var string 显示代码的后缀
     */
    public static $_prend = '</pre>';

    /**
     * @desc print_r
     * @param mixed $data
     */
    public static function print_r($data)
    {
        echo self::$_pre;
        print_r ( $data );
        echo self::$_prend;
        self::doexit ( $exit );
    }

    /**
     * @desc var_dump
     * @param mixed $data
     */
    public static function var_dump($data, $exit = false)
    {
        echo self::$_pre;
        var_dump ( $data );
        echo self::$_prend;
        self::doexit ( $exit );
    }

    public static function doexit($exit = false)
    {
        if ($exit === true)
        {
            exit ();
        }
    }
}